package com.itheima.jobs;

import com.itheima.constant.RedisConstant;
import org.springframework.beans.factory.annotation.Autowired;
import redis.clients.jedis.JedisPool;

/**
 * @author : [chenys]
 * @version : [v1.0]
 * @Description : 清空redis的缓存
 * @createTime : [2022/5/23 22:07]
 */
public class ClearRedisJob {
    @Autowired
    private JedisPool jedisPool;
    /**
     * 清空redis的缓存
     * @author chenxys
     * @param
     * @return void
     */
    public void clearRedis(){
         //1、清除七牛云垃圾图片
         ClearImgJob.clearImg();
         //2、清理redis数据
         jedisPool.getResource().del(RedisConstant.SET_MEAL_PIC_RESOURCES);
         jedisPool.getResource().del(RedisConstant.SET_MEAL_PIC_DB_RESOURCES);
    }
}
